import {defineStore} from "pinia";
import {computed, ref} from "vue";


const moneyStore = defineStore("money", () => {
    const money = ref(100);
    const rmb = computed(() => money.value);
    const dollar = computed(() => money.value * 0.14);
    const eu = computed(() => money.value * 0.13);

    const add=(arg)=>{
        money.value+=arg
    }

    const sub=(arg)=>{
        money.value-=arg
    }

    return {money, rmb, dollar, eu,add, sub}
})
//需要导出
export {moneyStore}
